require "Common/define"

LearnCtrl = {};
local this = LearnCtrl;

local transform;
local gameObject;
local isShowImg = false

--构建函数--
function LearnCtrl.New()
	logWarn("LearnCtrl.New--->>");
	return this;
end

function LearnCtrl.Awake()
	logWarn("LearnCtrl.Awake--->>");
	panelMgr:CreatePanel('Learn', this.OnCreate);
end

--启动事件--
function LearnCtrl.OnCreate(obj)
	gameObject = obj;
	transform = obj.transform;

    LuaBehaviour = transform:GetComponent('LuaBehaviour')
	-- panel = transform:GetComponent('UIPanel');
	-- prompt = transform:GetComponent('LuaBehaviour');
	-- logWarn("Start lua--->>"..gameObject.name);

	LuaBehaviour:AddClick(LearnPanel.btnLearn, this.OnClick);
	-- resMgr:LoadPrefab('prompt', { 'PromptItem' }, this.InitPanel);
end



--单击事件--
function LearnCtrl.OnClick(go)
	isShowImg = not isShowImg
	print('LearnCtrl.OnClick(go)')
	LearnPanel.imgGO:SetActive(isShowImg)
end



--关闭事件--
function LearnCtrl.Close()
	panelMgr:ClosePanel(CtrlNames.Learn);
end